﻿#include <iostream>
#include <map>
#include <set>
#include <string>
#include <functional>
#include <algorithm>
#include <vector>
using namespace std;
template<class Container>
void print(const Container& T)
{
	for (typename Container::const_iterator it = T.begin(); it != T.end(); ++it)
		cout << *it << " ";
	cout << endl;
}

template<class Containers>
auto Addgaptoiterator(const Containers& sit, int gap)
{
	typename Containers::const_iterator it = sit.begin();
	while (it != sit.end() && gap--)
	{
		++it;
	}
	return it;
}

void mapuse()
{
	map<string, int> mymap{
		{ "香蕉", 1 }, { "苹果", 2 }, { "梨", 3 },
		{ "樱桃", 4 }, { "西瓜", 5 }, { "水蜜桃", 6 }
	};
	//当有重复的key-value时，一种对应关系只会出现一次
	//一个key对应多个value时，会优先匹配先出现的
	map<int, char> mymap3{
		{1, 'a'}, {2, 'b'}, {3, 'c'}
	};
	map<string, int> mymap1(mymap);
	map<string, int> mymap2(map<string, int>);
	//正向迭代器
	for (auto it1 = mymap3.begin(); it1 != mymap3.end(); it1++)
	{
		cout << (*it1).first << "   " << (*it1).second << endl;
	}
	//反向迭代器
	for (auto it1 = mymap3.rbegin(); it1 != mymap3.rend(); it1++)
	{
		cout << (*it1).first << "   " << (*it1).second << endl;
	}
	//pair<iterator,bool> insert (const value_type& val);
	//可以根据second判断是否插入成功
	if (mymap3.insert({1, 'c'}).second == false)cout << "insert false" << endl;
	cout << "--------------------------" << endl;
	/*map<int, char> mymap4;
	mymap4.insert(mymap3.begin(), mymap3.end());
	for (auto it1 = mymap4.begin(); it1 != mymap4.end(); it1++)
	{
		cout << (*it1).first << "   " << (*it1).second << endl;
	}*/
	//auto it1 = mymap3.find(1); cout << (*it1).first << "\t" << (*it1).second << endl;
	//cout<<mymap3.count(1) << endl;//返回个数1/0
	/*auto it1 = Addgaptoiterator(mymap3, 2);
	mymap3.erase(mymap3.begin(), it1);
	cout << mymap3.size() << endl;*/
	/*mymap3.erase(3);
	for (auto it1 = mymap3.begin(); it1 != mymap3.end(); it1++)
	{
		cout << (*it1).first << "   " << (*it1).second << endl;
	}*/
	//auto it1 = mymap3.lower_bound(2);//返回大于等于key的迭代器
	/*mymap3.erase(mymap3.begin(), it1);
	for (auto it1 = mymap3.begin(); it1 != mymap3.end(); it1++)
	{
		cout << (*it1).first << "   " << (*it1).second << endl;
	}*/
	//[ lower_bound,upper_bound )查询的迭代器左闭右开
	//auto it1 = mymap3.upper_bound(1);//返回大于key的迭代器
	//mymap3.erase(mymap3.begin(), it1);
	//(*it1).second = 3;//只可以修改value,不可以修改key
	/*for (auto it1 = mymap3.begin(); it1 != mymap3.end(); it1++)
	{
		cout << (*it1).first << "   " << (*it1).second << endl;
	}*/
	/*string arr[] = { "苹果", "西瓜", "苹果", "西瓜", "苹果", "苹果", "西瓜",
					"苹果", "香蕉", "苹果", "香蕉" };
	map<string, int> mymap5;
	for (const auto& str : arr)
	{
		mymap5[str]++;
	}
	for (const auto& my : mymap5)
	{
		cout << my.first << "\t" << my.second << endl;
	}*/
	map<string, string> dict;
	dict.insert(make_pair("sort", "排序"));
	dict["insert"];
	cout << dict["insert"] << endl;
}


void setuse()
{
	set<int> s;
	s.insert(1);
	s.insert(1);
	s.insert(2);
	s.insert(3);
	cout << *s.begin() << endl;
	cout << *(--s.end()) << endl;
	set<int> s1;
	s1.insert(s.begin(), s.end());
	auto it1 = s1.find(1);//返回迭代器
	cout << *it1 << endl;
	cout << "dddddddddddddddddddddddddd" << endl;
	/*if (it1 == s1.end())
	{
		cout << "没有找到了" << endl;
	}
	else
	{
		cout << "有找到" << endl;
	}*/
	size_t number = s1.count(1);
	cout << number << endl;
	print(s);
	/*s1.erase(s1.begin(), s1.end());
	if (s1.empty())cout << "empty" << endl;
	else cout << "not empty" << endl;*/

	/*s1.erase(s1.begin());
	size_t it2 = s1.erase(1);*/
	/*if (!it2)cout << "erase failed" << endl;
	else cout << "erase finished" << endl;*/

	/*auto ss = Addgaptoiterator(s1, 2);
	s1.erase(s1.begin(), ss);*/
	for (int i = 0; i < 10; i++)s1.insert(i);
	auto it3 = s1.upper_bound(3);//返回大于的迭代器
	cout << *it3 << endl;
	it3 = s1.lower_bound(3);//返回小于等于的迭代器
	cout << *it3 << endl;
	print(s1);
	/*s1.clear();
	if (s1.empty())cout << "s1 is empty" << endl;
	else cout << "s1 is not empty" << endl;*/
	for (auto it4 = s1.rbegin(); it4 != s1.rend(); it4++)
	{
		cout << *it4 << " ";
	}
	cout << endl;
	//set<int>::iterator it;

	//set<int>::iterator it, pos;
	//print(s);
	//for (it = s.begin(); it != s.end();it++)
	//{
	//	if (*it == 1)it = s.erase(it);
	//	//it++;
	//}
	//print(s);
	/*for (it = s.begin(); it != s.end(); it++)
	{
		cout << *it <<" ";
	}
	pos = s.find(1);
	if (*pos == 1)cout << "找到了" << endl;
	else cout << "没有找到" << endl;
	cout << endl;*/

	//int rpos = upper_bound(2);
	//vector<int> v1{1, 1, 2, 3, 4, 5};
	//int length = unique(v1.begin(), v1.end()) - v1.begin();

	//set<int> myset = { 10,20,30,15,50 };
	//pair<set<int>::const_iterator, set<int>::const_iterator> ret;
	//ret = myset.equal_range(30);//是一个区间
	//cout << *ret.first << endl;//不小于给定值的元素
	//cout << *ret.second << endl;//大于给定值的元素
	if (s1.count(20))cout << "element is exit" << endl;//存在则返回1，不存在返回0
	else cout << "element is not exit" << endl;
}
void multisetuse()
{
	multiset<int> mset;
	for (int i = 0; i < 10; i++)mset.insert(i);
	mset.insert(1);
	cout << mset.count(1) << endl;
	auto it1 = mset.find(1);//返回中序的第一个迭代器，找不到返回end()
	print(mset);//不会去重，相同的值的遍历的结果会相邻
	/*multiset<int> mset1;
	mset1.insert(mset.begin(), mset.end());*/
	/*auto it = mset.find(20);
	if (it == mset.end())cout << "mset.end()" << endl;*/
	//mset.erase(1);//删除所有相同值
	//print(mset);
	/*auto it2 = Addgaptoiterator(mset, 4);
	mset.erase(mset.begin(), it2);

	print(mset);*/
}
//int main()
//{
//	mapuse();
//	//setuse();
//	//multisetuse();
//	return 0;
//}
//两个集合的交集
//class Solution {
//public:
//	vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
//		int a[1001] = { 0 }, b[1001] = { 0 };
//		vector<int> returnvector;
//		for (int i = 0; i < nums1.size(); i++)a[nums1[i]] = 1;
//		for (int i = 0; i < nums2.size(); i++)b[nums2[i]] = 1;
//		for (int i = 0; i < 1001; i++)
//		{
//			if (a[i] == 1 && b[i] == 1)returnvector.push_back(i);
//		}
//		return returnvector;
//	}
//};
#include<iostream>
#include<cmath>
using namespace std;
// 递归到一个状态时会保留此状态执行下一个状态，等到最后一个状态执行完后，
// 回退到上一个状态，接着执行完此状态后会再次回退到上一个状态，知道回到最初的状态
void solve(int x)
{
	for (int i = 14; i >= 0; i--)
	{
		if (pow(2, i) <= x)
		{
			if (i == 0)cout << "2(0)";
			else if (i == 1)cout << "2";
			else
			{
				cout << "2(";
				solve(i);
				cout << ")";
			}
			x -= pow(2, i);
			if (x != 0)cout << "+";
		}
	}
}
int main()
{
	int n;
	cin >> n;
	solve(n);
	return 0;
}